package tw.com.softleader.json.jackson.app;

import java.io.InputStream;

import com.fasterxml.jackson.databind.ObjectMapper;

import tw.com.softleader.json.jackson.entity.Question04Entity;
import tw.com.softleader.json.jackson.entity.Question05Entity;

public class Question05App {

	public static void main(String[] args) {
		
		// Read file as InputStream..
		InputStream in = Question05App.class.getResourceAsStream("/question05.json");
		
		Question05Entity q05Entity = null;
		try {
			// TODO 請將 q05Entity 載入 question05.json 的資料, 
			// 請將 question05.json 增加 matt 擁有 BMW 2 台, BENZ 5 台的 carMap			
			ObjectMapper objectMapper = new ObjectMapper();
			q05Entity = objectMapper.readValue(in, Question05Entity.class);

		} catch (Exception e) {
			e.printStackTrace();
		} 
		
		System.out.println(q05Entity);
		
	}
	
}
